package cn.edu.sjtu.process_status_data.util;

import cn.edu.sjtu.process_status_data.model.Result;
import cn.edu.sjtu.process_status_data.model.Status;

import java.sql.Timestamp;

public class ResultUtil {

    public static Result getResult(String name, Status status, Object data) {
        Result result = new Result();
        result.setTime(new Timestamp(System.currentTimeMillis()));
        result.setName(name);
        result.setStatus(status.ordinal());
        result.setData(data);
        return result;
    }
}
